package com.zj.project.viewmodel

import android.app.Application
import android.view.View
import android.widget.Toast
import androidx.annotation.NonNull
import androidx.lifecycle.MutableLiveData
import com.zj.project.common.base.BaseViewModel
import com.zj.project.common.expand.subscribe

/**
 * createTime:2021/7/26 16:57
 * auth:张继
 * des:
 */
class LoginViewModel(@NonNull app: Application) : BaseViewModel(app) {

    val liveData: MutableLiveData<String> by lazy {
        MutableLiveData()
    }
    val login = View.OnClickListener {
        api.login("18526650769").subscribe(this, {
            liveData.postValue("测试")
        }) {
            Toast.makeText(app, it.msg, Toast.LENGTH_SHORT).show()
        }
    }



}